package com.sky.task;

import com.sky.service.OrderTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class OrderTask {

    @Autowired
    private OrderTaskService orderService;
    //每1分钟执行一次
    @Scheduled(cron="0 0/1 * * * ?")
    public void orderTask() {
        log.info("orderTask");
    }
    //每天3点执行一次
    @Scheduled(cron="0 0 3 * * ?")
    public void clearOrderTask() {
        log.info("clearOrderTask");
    }
}
